

/**
  * listbox redirection
  */
function goToUrl(goToLocation){
    eval("document.location.href = '" + goToLocation );
}

//----BEGIN implement for paging----------//s
function GotoPage(iPage) 
{
    document.frm.curPg.value=iPage;
    document.frm.submit()          ;
}

function confirmDelete()
{
	return confirm("Bạn có chắc chắn xóa không");
}

function confirmDel()
{
	return alert("sorry Not delete.");
}

<!---------- Sâtrt codan anh----------------------->
  //*************************************************************//
  // defines
  // width to resize large images to
var maxWidth=200;
  // height to resize large images to
var maxHeight=250;
  // the id of the preview image tag
var outImage="previewField";

function choseImage(strImage)
{
  var source=strImage;
  //alert("strImage=" + strImage);
  globalPic=new Image();
  globalPic.src=source;

  setTimeout("applyChanges()",200);
}

var globalPic;
function applyChanges()
{
  var field=document.getElementById(outImage);
  var x=parseInt(globalPic.width);
  var y=parseInt(globalPic.height);
  if (x>maxWidth)
  {
    y*=maxWidth/x;
    x=maxWidth;
  }

  if (y>maxHeight)
  {
    x*=maxHeight/y;
    y=maxHeight;
  }
  field.style.display=(x<1 || y<1)?"none":"";
  field.src=globalPic.src;
  field.width=x;
  field.height=y;
}
<!---------- codan anhl----------------------->
<!---------- Begin checkall----------------------->
var checkflag = "false";
function check(field) {
	if (checkflag == "false") {
		for (i = 0; i < field.length; i++) {
			field[i].checked = true;
		}
		checkflag = "true";
		setValueById("checkall1","uncheck all");
		setValueById("checkall2","uncheck all");
		return "uncheck all";
	}
	else {
		for (i = 0; i <  field.length; i++) {
			field[i].checked = false; 
		}
		checkflag = "false";
		setValueById("checkall1","check all");
		setValueById("checkall2","check all");

		return "check all"; 
	}
}
//  -----------------End ---------------------------->
var xmlHttp;
function SearchCode(oForm){
	if(CheckForm(false)==false){
		return false;
	}else{
		try {
			alert('vao day khong');
			var hinhthucthanhtoan = document.frmSearch.idtt.value();
			var mahd = document.frmSearch.mahoadon.value();
			var url="../run/mainajax.php?modul=hoadon&action=SearchHD&tt="+hinhthucthanhtoan;
			alert(url);
			var aParams = "mahd="+encodeURIComponent(mahd);
			smc_XmlHttpSend(url,"POST",aParams,"showSearch",true);
			
		} catch (e) {
			alert(e.description);
		}
	}
	return false;
}
function showSearch(xmlHttpResult){
	smc_ShowResult(xmlHttpResult,"divError","div_result_search","");
}
function SearchCode(){
	var form = document.frmSearch ;
	if(form.mahoadon.value == ""){
		alert("Mời bạn nhập vào mã hóa đơn");
		form.mahoadon.focus();
		return false;
	}
	
}

